﻿using System;
using System.Collections.Generic;

using System.Text;
using ITAP.Core.Modelling;

namespace ITAP.Core.Utils
{
    public class IntersectionPointsConverter
    {
        public static ModelPoint[] PassiveToActive(ModelPoint[] intersectionPoints)
        {
            // 0  3  6
            // 1  4  7
            // 2  5  8

            // 9  12 15
            // 10 13 16
            // 11 14 17
            //
            ModelPoint[] activePoints = new ModelPoint[18];
            activePoints[0] = intersectionPoints[0];
            activePoints[3] = intersectionPoints[1];
            activePoints[6] = intersectionPoints[2];
            activePoints[1] = intersectionPoints[3];
            activePoints[4] = intersectionPoints[4];
            activePoints[7] = intersectionPoints[5];
            activePoints[2] = intersectionPoints[6];
            activePoints[5] = intersectionPoints[7];
            activePoints[8] = intersectionPoints[8];

            activePoints[9] = intersectionPoints[9];
            activePoints[12] = intersectionPoints[10];
            activePoints[15] = intersectionPoints[11];
            activePoints[10] = intersectionPoints[12];
            activePoints[13] = intersectionPoints[13];
            activePoints[16] = intersectionPoints[14];
            activePoints[11] = intersectionPoints[15];
            activePoints[14] = intersectionPoints[16];
            activePoints[17] = intersectionPoints[17];

            return activePoints;
        }

        public static ModelPoint[] ActiveToPassive(ModelPoint[] intersectionPoints)
        {
            throw new NotImplementedException();
        }
    }
}
